#作用：三级目录选择并回退
#作者：尚墨
#日期：2018年1月14日
#邮箱：ws1992jx@163.com

province = ["新疆","西藏","内蒙古"]
city = {"新疆":["乌鲁木齐","巴音郭楞蒙古自治州","伊犁哈萨克自治州","克孜勒苏柯尔克孜自治州"],
        "西藏":["拉萨","日喀则","阿里地区"],
        "内蒙古":["呼和浩特","包头","鄂尔多斯"]
}
county = {"乌鲁木齐":["沙依巴克区","天山区","新市区","维泰经济技术开发区","水磨沟区"],
          "巴音郭楞蒙古自治州":["库尔勒市","焉耆回族自治县","若羌县"],
          "伊犁哈萨克自治州":["伊宁市","奎屯市","乌苏市","沙湾县","阿勒泰市","布尔津县"],
          "克孜勒苏柯尔克孜自治州":["阿图什市","阿克陶市","阿合奇县","乌恰县"],
          "拉萨":["关城区","堆龙德庆区","林周县","墨竹工卡县"],
          "日喀则":["桑珠孜区","定日县","仲巴县"],
          "阿里地区":["葛尔县","普兰县","日土县"],
          "呼和浩特":["回民区","新城区","土默特左旗"],
          "包头":["昆都仑区","土默特右旗","达尔罕茂明安联合旗"],
          "鄂尔多斯":["康巴什区","准格尔旗","达拉特旗"]
}
'''
ct_vle = ""
cnt_vle = ""
'''

print(province)
ct = county.keys()
while True:
    pvn_vle = input("请选择省份：")
    for pve in province:
        if pve == pvn_vle:
            print(city[pve])
            break
    ct_vle = input("请选择市或州：")
    if ct_vle == "b":
        print(province)
    elif ct_vle == "q":
        break
    for ct in city[pve]:
        if ct == ct_vle:
            print(county[ct])
            break
    cnt_vle = input("请选择区县：")
    if cnt_vle == "b":
        print(city[pve])
    elif cnt_vle == "q":
        break


